package com.yidu.utils;

/**
 * <p>@author 陈子睿</p>
 * <p>@Date: 2021/1/20</p>
 * <p>@Time: 10:12</p>
 * <p>@Description: 分页功能</p>
 */
public class BaseVo {
    private Integer page; //第几页
    private Integer limit; //每页多少行
    private Integer startRows; //开始行数

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getStartRows() {
        //如果没有传入分页数据，则默认第一页，每页显示10
        if(page ==null || limit ==null){
            page = 1;
            limit = 10;
        }
        startRows = (page-1)*limit;
        return startRows;
    }

    public void setStartRows(Integer startRows) {
        this.startRows = startRows;
    }
}
